<?php

/**
 * This is the model class for table "sys_cron_info".
 *
 * The followings are the available columns in table 'sys_cron_info':
 * @property integer $corn_id
 * @property integer $cron_status
 * @property string $cron_description
 * @property string $cron_order
 * @property integer $cron_runtime_begin
 * @property integer $cron_runtime_end
 * @property string $cron_title
 */
class SysCronInfo extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return SysCronInfo the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sys_cron_info';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
		array('cron_status, cron_runtime_begin, cron_runtime_end', 'numerical', 'integerOnly'=>true),
		array('cron_order', 'length', 'max'=>200),
		array('cron_title', 'length', 'max'=>100),
		array('cron_description', 'safe'),
		// The following rule is used by search().
		// Please remove those attributes that should not be searched.
		array('corn_id, cron_status, cron_description, cron_order, cron_runtime_begin, cron_runtime_end, cron_title', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'corn_id' => 'Corn',
			'cron_status' => 'Cron Status',
			'cron_description' => 'Cron Description',
			'cron_order' => 'Cron Order',
			'cron_runtime_begin' => 'Cron Runtime Begin',
			'cron_runtime_end' => 'Cron Runtime End',
			'cron_title' => 'Cron Title',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('corn_id',$this->corn_id);
		$criteria->compare('cron_status',$this->cron_status);
		$criteria->compare('cron_description',$this->cron_description,true);
		$criteria->compare('cron_order',$this->cron_order,true);
		$criteria->compare('cron_runtime_begin',$this->cron_runtime_begin);
		$criteria->compare('cron_runtime_end',$this->cron_runtime_end);
		$criteria->compare('cron_title',$this->cron_title,true);

		return new CActiveDataProvider(get_class($this), array(
			'criteria'=>$criteria,
		));
	}
}